package com.dm.commons.result;

/*
* 返回结果工具集
* */
public class Result<T> {

    private Integer code;  //状态码

    private String message;  //信息

    private T data;  //数据

    private String errorMessage; //错误信息

    public Result(){

    }

    public Result(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public Result<T> setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        return this;
    }

    public Integer getCode(){
        return this.code;
    }

    public Result<T> setCode(Integer code){
        this.code = code;
        return this;
    }

    public String getMessage(){
        return this.message;
    }

    public Result<T> setMessage(String message){
        this.message = message;
        return this;
    }

    public T getData(){
        return this.data;
    }

    public Result<T> setData(T data){
        this.data = data;
        return this;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }

}